Skip to content

fix(analyze): exclude rationale nodes from gap questions#1780

Closed
balloon72 wants to merge 1 commit into
Graphify-Labs:v8from
balloon72:codex/rationale-gap-count
Closed

fix(analyze): exclude rationale nodes from gap questions#1780
balloon72 wants to merge 1 commit into
Graphify-Labs:v8from
balloon72:codex/rationale-gap-count

Conversation

@balloon72

Copy link
Copy Markdown
Contributor

Summary

Keep the isolated-node count in suggested questions consistent with the report's Knowledge Gaps section.

Root cause

report.py excludes rationale nodes from knowledge gaps because their expected shape is a single edge to the symbol they explain. suggest_questions() applied the other report filters but omitted that exclusion, so the same graph could show two different isolated-node counts.

Changes

  • Apply the existing file_type != "rationale" filter in suggest_questions().
  • Add a regression test that keeps a normal isolated node while excluding the rationale node from the count and question text.

This intentionally does not change cohesion scoring or add JSON/TypeScript naming heuristics.

Validation

  • python -m pytest tests/test_analyze.py tests/test_report.py tests/test_cluster.py -q (74 passed)
  • python -m py_compile graphify/analyze.py tests/test_analyze.py
  • python -m graphify update .
  • git diff --check origin/v8...HEAD

The full local suite was not repeated because Windows Store Python crashed in existing ProcessPoolExecutor pipeline tests during the earlier full-suite attempt. GitHub CI remains the full-suite check.

Addresses the count mismatch in #1768.

@balloon72 balloon72 marked this pull request as ready for review July 11, 2026 04:52
@safishamsi

Copy link
Copy Markdown
Collaborator

Merged on v8, authored to you. Confirmed parity: report.py's Knowledge Gaps filter (degree<=1, not file, not concept, file_type != rationale) now matches suggest_questions() exactly, so the two numbers in the same report agree. 49 analyze tests pass. Thanks — clean consistency fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants